﻿using Model.DomainModel.Sys;

namespace Infrastructure.IRepository.Sys
{
    /// <summary>
    /// 按钮角色仓储接口
    /// </summary>
    public interface ISysButtonRoleRepository : IRepository<SysButtonRole>
    {
        /// <summary>
        /// 根据角色获取菜单和按钮关系
        /// </summary>
        /// <param name="roleId">角色id</param>
        /// <returns></returns>
        List<SysButtonRole> GetButtonRoleByRoleId(List<int> roleId);

        /// <summary>
        /// 根据角色id删除数据
        /// </summary>
        /// <param name="roleId">角色id</param>
        void DeleteByRoleId(int roleId);

        /// <summary>
        /// 新增按钮和角色关系
        /// </summary>
        /// <param name="list"></param>
        void BatchInsert(List<SysButtonRole> list);

        /// <summary>
        /// 根据角色id和菜单id获取按钮
        /// </summary>
        /// <param name="roleId">角色id</param>
        /// <param name="menuId">菜单id</param>
        /// <returns>返回对应按钮集合</returns>
        List<SysButtonRole> GetButtonByRoleIdOrMenuId(List<int> roleId, string menuId);
    }
}
